import express from 'express'
var router = express.Router()

import request from '../../../util/request.js'

const getMapInfo = () =>{
  return request({
    method: 'get',
    url: 'https://uri.amap.com/marker',
    position: '116.473195,39.993253',
  })
}

const url = 'https://uri.amap.com/marker?position=116.473195,39.993253'

router.get('/reverse',(req, res, next) => {
  getMapInfo().then((result) => {
    
    res.json(req.app.locals.success(url))
  }).catch((err) => {
    
    res.json(req.app.locals.err(err))
  });
})


export default router